package bitcat.chuenyee.dao.mapper

import bitcat.chuenyee.dao.provider.DynamicSqlProvider
import org.apache.ibatis.annotations.*

@Mapper
interface DynamicCrudMapper {

    @InsertProvider(type = DynamicSqlProvider::class, method = "insert")
    fun insert(params: Map<String, Any>): Int

    @SelectProvider(type = DynamicSqlProvider::class, method = "select")
    fun select(params: Map<String, Any>): List<Map<String, Any>>

    @UpdateProvider(type = DynamicSqlProvider::class, method = "update")
    fun update(params: Map<String, Any>): Int

    @DeleteProvider(type = DynamicSqlProvider::class, method = "delete")
    fun delete(params: Map<String, Any>): Int
}
